/**
 * Created by zhangyunqi on 2017/6/11.
 */

import java.io.File;
import java.io.FileInputStream;
import java.lang.ArrayIndexOutOfBoundsException;


public class Markov {

    public static void main(String[] args) throws Exception {
        Chain chain = new Chain ();
        long nwords = Integer.parseInt ( args[0] );
        FileInputStream fis = new FileInputStream ( new File ( "C:\\Users\\think\\Desktop\\syx.txt" ) );
        //要读入的文章，之后生成的文章要依据此文章改进

        chain.build ( fis );
        chain.generate ((int) nwords);
    }

}
